package com.shen.GOF.adapter;

//客户端类：想上网，插不上网线
public class Computer {
    //增加转接器
    public void online(USB usb) {
        //上网具体实现
        usb.handle();
    }

    //模拟上网
    public static void main(String[] args) {
   //需要电脑、适配器、网线
        Computer computer = new Computer();
        Adapter adapter = new Adapter();
        USBTwo usbTwo = new USBTwo(adapter);

        computer.online(usbTwo);
    }
}
